package com.partyjoin.project.module.developmentEvolve.service;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.partyjoin.common.utils.StringUtils;
import com.partyjoin.project.module.developmentEvolve.mapper.DevelopmentEvolveMapper;
import com.partyjoin.project.module.developmentEvolve.domain.DevelopmentEvolve;
import com.partyjoin.project.module.developmentEvolve.service.IDevelopmentEvolveService;
import com.partyjoin.common.support.Convert;

/**
 * 发展发展对象记录 服务层实现
 * 
 * @author 莫东林
 * @date 2018-07-19
 */
@Service
public class DevelopmentEvolveServiceImpl implements IDevelopmentEvolveService 
{

	@Autowired
	private DevelopmentEvolveMapper developmentEvolveMapper;


	/**
     * 查询发展发展对象记录信息
     * 
     * @param developmentEvolveId 发展发展对象记录ID
     * @return 发展发展对象记录信息
     */
    @Override
	public DevelopmentEvolve selectDevelopmentEvolveById(Integer developmentEvolveId)
	{
	    return developmentEvolveMapper.selectDevelopmentEvolveById(developmentEvolveId);
	}
	
	/**
     * 查询发展发展对象记录列表
     * 
     * @param developmentEvolve 发展发展对象记录信息
     * @return 发展发展对象记录集合
     */
	@Override
	public List<DevelopmentEvolve> selectDevelopmentEvolveList(DevelopmentEvolve developmentEvolve)
	{
	    return developmentEvolveMapper.selectDevelopmentEvolveList(developmentEvolve);
	}
	
    /**
     * 新增发展发展对象记录
     * 
     * @param developmentEvolve 发展发展对象记录信息
     * @return 结果
     */
	@Override
	public int insertDevelopmentEvolve(DevelopmentEvolve developmentEvolve)
	{
	    return developmentEvolveMapper.insertDevelopmentEvolve(developmentEvolve);
	}
	
	/**
     * 修改发展发展对象记录
     * 
     * @param developmentEvolve 发展发展对象记录信息
     * @return 结果
     */
	@Override
	public int updateDevelopmentEvolve(DevelopmentEvolve developmentEvolve)
	{
	    return developmentEvolveMapper.updateDevelopmentEvolve(developmentEvolve);
	}
	
	/**
     * 保存发展发展对象记录
     * 
     * @param developmentEvolve 发展发展对象记录信息
     * @return 结果
     */
	@Override
	public int saveDevelopmentEvolve(DevelopmentEvolve developmentEvolve)
	{
	    Integer developmentEvolveId = developmentEvolve.getDevelopmentEvolveId();
		int rows = 0;
		if (StringUtils.isNotNull(developmentEvolveId))
        {
		    rows = developmentEvolveMapper.updateDevelopmentEvolve(developmentEvolve);
		}
		else
        {
		    rows = developmentEvolveMapper.insertDevelopmentEvolve(developmentEvolve);
		}
		return rows;
	}
	
	/**
     * 删除发展发展对象记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteDevelopmentEvolveByIds(String ids)
	{
		return developmentEvolveMapper.deleteDevelopmentEvolveByIds(Convert.toStrArray(ids));
	}


}
